home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / csim / source.lha / source / Threads / GnuThreads / sun3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-14  |  1.2 KB  |  37 lines

  1. /*
  2.  * init.c -- lightweight process initialisation for sun3.
  3.  * Copyright (C) 1991 Stephen Crane.
  4.  *
  5.  * This is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 1, or (at your option)
  8.  * any later version.
  9.  *
  10.  * This software is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * see the file COPYING.  If not, write to
  17.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  * author: Stephen Crane, (jsc@doc.ic.ac.uk), Department of Computing,
  20.  * Imperial College of Science, Technology and Medicine, 180 Queen's
  21.  * Gate, London SW7 2BZ, England.
  22.  */
  23.  
  24. #include "gnulwp.h"
  25.  
  26. #include <setjmp.h>
  27.  
  28. /*
  29.  * initp -- initialise a new process's context.  Stack pointer in
  30.  * newp->context[0], because it's easier for the SPARC code.
  31.  */
  32. void initp (struct pcb *newp)
  33. {
  34.     newp->context[2] = newp->context[0];
  35.     newp->context[3] = (int)wrapp;
  36. }
  37.